package com.umer.pinban.datafenxi.adapter;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.common.ui.recycleview.adapter.RecyclerviewBasicAdapter;
import com.common.ui.recycleview.base.ViewHolder;
import com.common.ui.recycleview.listener.OptListener;
import com.umer.pinban.R;
import com.umer.pinban.bean.fenxi.CustomerTypeListBean;
import java.util.List;

public class DataFenXiAdapterOne extends RecyclerviewBasicAdapter<CustomerTypeListBean> {

    private OptListener optListener;

    public DataFenXiAdapterOne(Context context, List<CustomerTypeListBean> datas, int layoutId,
                               OptListener optListener) {
        super(context, datas, layoutId);
        this.optListener = optListener;
    }

    @Override
    public void convert(ViewHolder holder, final CustomerTypeListBean customerTypeListBean, final int position) {

        LinearLayout linear_one = holder.getView(R.id.linear_one);
        TextView tv_one_type = holder.getView(R.id.tv_one_type);
        TextView tv_one_number = holder.getView(R.id.tv_one_number);
        tv_one_type.setText("" + customerTypeListBean.getLabel());
        tv_one_number.setText("" + customerTypeListBean.getNum()+"人");
        linear_one.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                optListener.onOptClick(v,position);
            }
        });
    }
}
